<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://www.yaodian100.com/jsp/yaodian100" prefix="yaodian100" %>
<%@ include file="/taglibs.jsp"%>
<s:url value="/images" var="imgPath"/>
<!-- 月历 -->
<script type="text/javascript" charset="UTF-8" src="/js/jquery.datepick.js"></script>
<script type="text/javascript" charset="UTF-8" src="/js/jquery.datepick-zh-CN.js"></script>
<script language="javascript">
	$().ready( function() {
		$('#paramStartDate').datepick({minDate: null, showOn: 'both', 
	    	buttonImageOnly: true, buttonImage: '${imgPath}/calendar.gif',numberOfMonths:2,dateFormat:"yy-mm-dd",yearRange: '-50:+50'});
	});
function checkHidden() {
	var executeNowFlag = $('input:radio[name=paramExecuteNow]:checked').val();
	//alert(executeNow+"/"+(executeNow == 'true'));
	if( executeNowFlag == 'true') {
		$("#spanStartDate").hide();
		$("#spanStartDate_hidden").show();
	} else {
		$("#spanStartDate").show();
		$("#spanStartDate_hidden").hide();
	}
}
</script>
<link rel="stylesheet" type="text/css" href="/css/smoothness.datepick.css" />
<link rel="stylesheet" type="text/css" href="/css/jquery-ui-1.7.2.custom.css"/>
<s:actionerror cssClass="errmsg"/>
<s:actionmessage cssClass="errmsg"/>
  <h1>核对资料/完成编辑 - 批次修改订制商品</h1>
  <div class="batchstep">
    <div class="batchstep-3">
      <span class="step1">Step 1：查寻商品/选取商品</span>
      <span class="step2">Step 2：编辑资料</span>
      <span class="onstep3">Step 3：核对资料/完成编辑</span>
    </div>
  </div>

      <s:form action="done.do">
      <s:hidden name="paramBatchEventId"/>
	  <div class="tipmsg"><ul><li>系统会在你所指定的时间开始排程，并非开始执行。</li></ul></div>
        <h3 class="tword">请选择此批次开始排程时间：</h3>
		<table class="tb-edit">
          <tr>
          	<th>批次排程时间</th><td>
          	<s:radio list="#{'true':'立即排程','false':'预约排程'}" name="paramExecuteNow" id="paramExecuteNow" listKey="key" listValue="value" onchange="checkHidden();"/></td>
          </tr>
          <tr>
          	<th>预约时间</th><td>
          	<span id="spanStartDate">
          	<s:textfield name="paramStartDate" size="10" id="paramStartDate"/>
            <s:select list="menuTime" name="paramStartTime" style="background:#FFDFDF"/>
            <s:fielderror fieldName="paramStartTime" cssClass="errmsg"></s:fielderror></span>
            <span id="spanStartDate_hidden" style="display: none;">-</span>
            </td>
          </tr>
        </table>
		<br /><a href="edit.do" class="pstep">﹤回上一步</a> 
		<input type="submit" value="核对无误，确认送出" name="submit1" class="nstep">
      <br />
      <h3 class="tword">请核对你所套用的 ${fn:length(detailMap)} 笔资料：</h3>
	  <table width="100%" class="tb-1">
        <thead>
          <th>商品编号</th>
          <th>商品名称</th>
          <th>供应商编号</th>
          <th>主分类</th>
          <th>商品型态</th>
          <th>是否使用"订制商品"?</th>
          <th>订制商品天数</th>
        </thead>
        <tbody>
  	 <c:forEach items="${detailMap}" var="map" varStatus="rows_index" begin="${pager.startRecord}" end="${pager.endRecord}">
          <tr class="${rows_index.count % 2 == 0 ? 'bg-yl' : ''}">
           <td>${map.key}</td>
           <td style="text-align:left;">${map.value.dataOldMap['productName']}</td>
           <td>${map.value.dataOldMap['supplierId']}</td>
           <td style="text-align:left;">${map.value.dataOldMap['mainCategoryPathDesc']}</td>
           <td>${map.value.dataOldMap['productType']}</td>
           <td><span class="txt-red">
           <c:if test='${map.value.dataNewMap["useDeliveryDay"] == "Y"}'>是</c:if>
           <c:if test='${map.value.dataNewMap["useDeliveryDay"] == "N"}'>否</c:if>
           </span></td>
           <td><span class="txt-red">
           <c:if test='${map.value.dataNewMap["useDeliveryDay"] == "Y"}'>${map.value.dataNewMap['deliveryDay']}</c:if>
          <c:if test='${map.value.dataNewMap["useDeliveryDay"] == "N"}'>-</c:if>
           </td>
          </tr> </c:forEach>
        </tbody>
      </table>
<yaodian100:pageutil link="confirm.do" pagerObj="${pager}" />
      <br /><a href="edit.do" class="pstep">﹤回上一步</a> 
      <input type="submit" value="核对无误，确认送出" name="submit1" class="nstep"><br />
    </s:form>